
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Django 1.8.2 release notes &#8212; Django 1.11.22.dev20190603194737 documentation</title>
    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <script type="text/javascript" src="../_static/language_data.js"></script>
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Django 1.8.1 release notes" href="1.8.1.html" />
    <link rel="prev" title="Django 1.8.3 release notes" href="1.8.3.html" />



 
<script type="text/javascript" src="../templatebuiltins.js"></script>
<script type="text/javascript">
(function($) {
    if (!django_template_builtins) {
       // templatebuiltins.js missing, do nothing.
       return;
    }
    $(document).ready(function() {
        // Hyperlink Django template tags and filters
        var base = "../ref/templates/builtins.html";
        if (base == "#") {
            // Special case for builtins.html itself
            base = "";
        }
        // Tags are keywords, class '.k'
        $("div.highlight\\-html\\+django span.k").each(function(i, elem) {
             var tagname = $(elem).text();
             if ($.inArray(tagname, django_template_builtins.ttags) != -1) {
                 var fragment = tagname.replace(/_/, '-');
                 $(elem).html("<a href='" + base + "#" + fragment + "'>" + tagname + "</a>");
             }
        });
        // Filters are functions, class '.nf'
        $("div.highlight\\-html\\+django span.nf").each(function(i, elem) {
             var filtername = $(elem).text();
             if ($.inArray(filtername, django_template_builtins.tfilters) != -1) {
                 var fragment = filtername.replace(/_/, '-');
                 $(elem).html("<a href='" + base + "#" + fragment + "'>" + filtername + "</a>");
             }
        });
    });
})(jQuery);
</script>


  </head><body>

    <div class="document">
  <div id="custom-doc" class="yui-t6">
    <div id="hd">
      <h1><a href="../index.html">Django 1.11.22.dev20190603194737 documentation</a></h1>
      <div id="global-nav">
        <a title="Home page" href="../index.html">Home</a>  |
        <a title="Table of contents" href="../contents.html">Table of contents</a>  |
        <a title="Global index" href="../genindex.html">Index</a>  |
        <a title="Module index" href="../py-modindex.html">Modules</a>
      </div>
      <div class="nav">
    &laquo; <a href="1.8.3.html" title="Django 1.8.3 release notes">previous</a>
     |
    <a href="index.html" title="Release notes" accesskey="U">up</a>
   |
    <a href="1.8.1.html" title="Django 1.8.1 release notes">next</a> &raquo;</div>
    </div>

    <div id="bd">
      <div id="yui-main">
        <div class="yui-b">
          <div class="yui-g" id="releases-1.8.2">
            
  <div class="section" id="s-django-1-8-2-release-notes">
<span id="django-1-8-2-release-notes"></span><h1>Django 1.8.2 release notes<a class="headerlink" href="#django-1-8-2-release-notes" title="Permalink to this headline">¶</a></h1>
<p><em>May 20, 2015</em></p>
<p>Django 1.8.2 fixes a security issue and several bugs in 1.8.1.</p>
<div class="section" id="s-fixed-session-flushing-in-the-cached-db-backend">
<span id="fixed-session-flushing-in-the-cached-db-backend"></span><h2>Fixed session flushing in the <code class="docutils literal notranslate"><span class="pre">cached_db</span></code> backend<a class="headerlink" href="#fixed-session-flushing-in-the-cached-db-backend" title="Permalink to this headline">¶</a></h2>
<p>A change to <code class="docutils literal notranslate"><span class="pre">session.flush()</span></code> in the <code class="docutils literal notranslate"><span class="pre">cached_db</span></code> session backend in Django
1.8 mistakenly sets the session key to an empty string rather than <code class="docutils literal notranslate"><span class="pre">None</span></code>. An
empty string is treated as a valid session key and the session cookie is set
accordingly. Any users with an empty string in their session cookie will use
the same session store. <code class="docutils literal notranslate"><span class="pre">session.flush()</span></code> is called by
<code class="docutils literal notranslate"><span class="pre">django.contrib.auth.logout()</span></code> and, more seriously, by
<code class="docutils literal notranslate"><span class="pre">django.contrib.auth.login()</span></code> when a user switches accounts. If a user is
logged in and logs in again to a different account (without logging out) the
session is flushed to avoid reuse. After the session is flushed (and its
session key becomes <code class="docutils literal notranslate"><span class="pre">''</span></code>) the account details are set on the session and the
session is saved. Any users with an empty string in their session cookie will
now be logged into that account.</p>
</div>
<div class="section" id="s-bugfixes">
<span id="bugfixes"></span><h2>Bugfixes<a class="headerlink" href="#bugfixes" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>Fixed check for template engine alias uniqueness (<a class="reference external" href="https://code.djangoproject.com/ticket/24685">#24685</a>).</li>
<li>Fixed crash when reusing the same <code class="docutils literal notranslate"><span class="pre">Case</span></code> instance in a query
(<a class="reference external" href="https://code.djangoproject.com/ticket/24752">#24752</a>).</li>
<li>Corrected join promotion for <code class="docutils literal notranslate"><span class="pre">Case</span></code> expressions. For example, annotating a
query with a  <code class="docutils literal notranslate"><span class="pre">Case</span></code> expression could unexpectedly filter out results
(<a class="reference external" href="https://code.djangoproject.com/ticket/24766">#24766</a>).</li>
<li>Fixed negated <code class="docutils literal notranslate"><span class="pre">Q</span></code> objects in expressions. Cases like
<code class="docutils literal notranslate"><span class="pre">Case(When(~Q(friends__age__lte=30)))</span></code> tried to generate a subquery which
resulted in a crash (<a class="reference external" href="https://code.djangoproject.com/ticket/24705">#24705</a>).</li>
<li>Fixed incorrect GROUP BY clause generation on MySQL when the query’s model
has a self-referential foreign key (<a class="reference external" href="https://code.djangoproject.com/ticket/24748">#24748</a>).</li>
<li>Implemented <code class="docutils literal notranslate"><span class="pre">ForeignKey.get_db_prep_value()</span></code> so that <code class="docutils literal notranslate"><span class="pre">ForeignKey</span></code>s
pointing to <a class="reference internal" href="../ref/models/fields.html#django.db.models.UUIDField" title="django.db.models.UUIDField"><code class="xref py py-class docutils literal notranslate"><span class="pre">UUIDField</span></code></a> and inheritance on models
with <code class="docutils literal notranslate"><span class="pre">UUIDField</span></code> primary keys work correctly (<a class="reference external" href="https://code.djangoproject.com/ticket/24698">#24698</a>,
<a class="reference external" href="https://code.djangoproject.com/ticket/24712">#24712</a>).</li>
<li>Fixed <code class="docutils literal notranslate"><span class="pre">isnull</span></code> lookup for <code class="docutils literal notranslate"><span class="pre">HStoreField</span></code> (<a class="reference external" href="https://code.djangoproject.com/ticket/24751">#24751</a>).</li>
<li>Fixed a MySQL crash when a migration removes a combined index (unique_together
or index_together) containing a foreign key (<a class="reference external" href="https://code.djangoproject.com/ticket/24757">#24757</a>).</li>
<li>Fixed session cookie deletion when using <a class="reference internal" href="../ref/settings.html#std:setting-SESSION_COOKIE_DOMAIN"><code class="xref std std-setting docutils literal notranslate"><span class="pre">SESSION_COOKIE_DOMAIN</span></code></a>
(<a class="reference external" href="https://code.djangoproject.com/ticket/24799">#24799</a>).</li>
<li>On PostgreSQL, when no access is granted for the <code class="docutils literal notranslate"><span class="pre">postgres</span></code> database,
Django now falls back to the default database when it normally requires a
“no database” connection (<a class="reference external" href="https://code.djangoproject.com/ticket/24791">#24791</a>).</li>
<li>Fixed display of <code class="docutils literal notranslate"><span class="pre">contrib.admin</span></code>’s <code class="docutils literal notranslate"><span class="pre">ForeignKey</span></code> widget when it’s used
in a row with other fields (<a class="reference external" href="https://code.djangoproject.com/ticket/24784">#24784</a>).</li>
</ul>
</div>
</div>


          </div>
        </div>
      </div>
      
        
          <div class="yui-b" id="sidebar">
            
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../contents.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Django 1.8.2 release notes</a><ul>
<li><a class="reference internal" href="#fixed-session-flushing-in-the-cached-db-backend">Fixed session flushing in the <code class="docutils literal notranslate"><span class="pre">cached_db</span></code> backend</a></li>
<li><a class="reference internal" href="#bugfixes">Bugfixes</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="1.8.3.html"
                        title="previous chapter">Django 1.8.3 release notes</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="1.8.1.html"
                        title="next chapter">Django 1.8.1 release notes</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../_sources/releases/1.8.2.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
              <h3>Last update:</h3>
              <p class="topless">Jun 03, 2019</p>
          </div>
        
      
    </div>

    <div id="ft">
      <div class="nav">
    &laquo; <a href="1.8.3.html" title="Django 1.8.3 release notes">previous</a>
     |
    <a href="index.html" title="Release notes" accesskey="U">up</a>
   |
    <a href="1.8.1.html" title="Django 1.8.1 release notes">next</a> &raquo;</div>
    </div>
  </div>

      <div class="clearer"></div>
    </div>
  </body>
</html>